#include <string>
#include "dh_math.h"



// Make into UINT RGBA format (OpenGL) //
static unsigned int MAKE_RGBA(unsigned char a, unsigned char r, unsigned char g, unsigned char b)
{
	return( (unsigned int)((a << 24) | (b << 16) | (g << 8) | (r)) );	
}

// Make into UINT BGRA format (IRIX) //
static unsigned int MAKE_BGRA(unsigned char a, unsigned char r, unsigned char g, unsigned char b)
{
	return( (unsigned int)((b << 24) | (g << 16) | (r << 8) | (a)) );
}

// Make into UINT ARGB format (Direct3D) //
static unsigned int MAKE_ARGB(unsigned char a, unsigned char r, unsigned char g, unsigned char b)
{
	return( (unsigned int)((a << 24) | (r << 16) | (g << 8) | (b)) );
}



enum DATA_FORMAT 
{
	FORMAT_UNKNOWN					= 0,
	
	FORMAT_RGBA32_RAW				= 1,
	FORMAT_RGBA32_FLOAT				= 2,
	FORMAT_RGBA32_UINT				= 3,
	FORMAT_RGBA32_SINT				= 4,
	
	FORMAT_RGB32_RAW				= 5,
	FORMAT_RGB32_FLOAT				= 6,
	FORMAT_RGB32_UINT				= 7,
	FORMAT_RGB32_SINT				= 8,
	
	FORMAT_RGBA16_RAW				= 9,	
	FORMAT_RGBA16_FLOAT				= 10,
	FORMAT_RGBA16_UNORM				= 11,
	FORMAT_RGBA16_UINT				= 12,
	FORMAT_RGBA16_SNORM				= 13,
	FORMAT_RGBA16_SINT				= 14,
	
	FORMAT_RG32_RAW					= 15,
	FORMAT_RG32_FLOAT				= 16,
	FORAMT_RG32_UINT				= 17,
	FORMAT_RG32_SINT				= 18,
	
	FORMAT_RGBA8_RAW				= 27,
	FORMAT_RGBA8_UNORM				= 28,
	FORMAT_RGBA8_UNORM_SRGB			= 29,
	FORMAT_RGBA8_UINT				= 30,
	FORMAT_RGBA8_SNORM				= 31,
	FORMAT_RGBA8_SINT				= 32,
	
};



//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
//					SHADER PROFILE LOOKUPS										  //
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//

static std::string VERTEX_SHADER_PROFILES[] = 
{
	"",							// Not Supported
	"vs_1_1",					// Shader Model 1
	"vs_2_0",					// Shader Model 2
	"vs_2_x",					// Shader Model 2x   (9.0c)
	"vs_3_0",					// Shader Model 3
	"vs_4_0",					// Shader Model 4    (10.0)
	"vs_4_1",					// Shader Model 4    (10.1)
	"vs_5_0",					// Shader Model 5    (11)
};


static std::string PIXEL_SHADER_PROFILES[] = 
{
	"",							// Not Supported
	"",							// Shader Model 1
	"ps_2_0",					// Shader Model 2
	"ps_2_x",					// Shader Model 2x    (9.0c)
	"ps_3_0",					// Shader Model 3
	"ps_4_0",					// Shader Model 4     (10.0)
	"ps_4_1",					// Shader Model 4     (10.1)
	"ps_5_0",					// Shader Model 5	  (11)
};


static std::string GEOMETRY_SHADER_PROFILES[] = 
{
	"",
	"",
	"",
	"",
	"",
	"gs_4_0",					// Shader Model 4		(10.0)
	"gs_4_1",					// Shader Model 4		(10.1)
	"gs_5_0",					// Shader Model 5		(11)
};


static std::string COMPUTE_SHADER_PROFILES[] = 
{
	"",
	"",
	"",
	"",
	"",
	"cs_4_0",					// Shader Model 4		(10.0 preview)
	"cs_4_1",					// Shader Model 4		(10.1 preview)
	"cs_5_0",					// Shader Model 5		(11)
};

static std::string HULL_SHADER_PROFILES[] = 
{
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"hs_5_0",					// Shader Model 5		(11)
};

static std::string DOMAIN_SHADER_PROFILES[] =
{
	"",
	"",
	"",
	"",
	"",
	"",
	"",
	"ds_5_0",					// Shader Model 5		(11)
};

static std::string EFFECT_PROFILES[] = 
{
	"",
	"",
	"fx_1_0",
	"fx_2_0",
	"fx_3_0",
	"fx_4_0",
	"fx_4_1",
	"fx_5_0",
};


//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
//							BASIC VERTEX TYPES									  //
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//


struct dh_colored_vertex
{
	dh_vec3f		pos;
	unsigned int	color;
};